// 引入vuerouter的相关包
import { createWebHashHistory, createRouter } from "vue-router";

// 引入要使用的相关vue组件文件
// 引入登录组件
// import Login from "@/components/Login/Login";
// 引入主题
import Index from "@/views/Main/Main.vue";
// 引入Home页
import Home from "@/views/Home/Home.vue";
// 引入招商加盟页
import Attract from "@/views/Attract/Attract.vue";
// 引入产品展示页
import Product from "@/views/Product/Product.vue";

import About from "@/views/About/About.vue";

// 创建实例化对象
const history = createWebHashHistory();
const router = createRouter({
  history,
  routes: [
    // {
    //   name: "登录页",
    //   path: "/login",
    //   component: Login,
    // },
    {
      name: "主体页",
      path: "/index",
      redirect: "/home",
      component: Index,
      children: [
        {
          name: "首页",
          path: "/home",
          component: Home,
        },
        {
          name: "产品展示",
          path: "/product",
          component: Product,
        },
        {
          name: "招商加盟",
          path: "/attract",
          component: Attract,
        },
        {
          name: "关于我们",
          path: "/about",
          component: About,
        },
      ],
    },
  ],
});

// 把router路径暴露出去
export default router;
